#include <stdio.h>
#include <windows.h>

int ScreenSize(int *pW, int *pH)
{
	*pW = GetSystemMetrics(SM_CXSCREEN);
	*pH = GetSystemMetrics(SM_CYSCREEN);
	return 0;
}

void ScreenFenBianLv_01()
{
	DEVMODEA devMode;
	EnumDisplaySettingsA(NULL, ENUM_CURRENT_SETTINGS, &devMode);

	printf("devMode.dmDeviceName: %s\n", devMode.dmDeviceName);
	printf("devMode.dmSpecVersion: %d\n", devMode.dmSpecVersion);
	printf("devMode.dmDriverVersion: %d\n", devMode.dmDriverVersion);
	printf("devMode.dmSize: %d\n", devMode.dmSize);
	printf("devMode.dmDriverExtra: %d\n", devMode.dmDriverExtra);

	printf("\n");
	printf("devMode.dmFields: %u\n", devMode.dmFields); // DM_PELSWIDTH(0x00080000L)  DM_PELSHEIGHT(0x00100000L)
	printf("devMode.dmPelsWidth: %u\n", devMode.dmPelsWidth);
	printf("devMode.dmPelsHeight: %u\n", devMode.dmPelsHeight);
	printf("devMode.dmDisplayFrequency: %u\n", devMode.dmDisplayFrequency);
	printf("devMode.dmBitsPerPel: %u\n", devMode.dmBitsPerPel);

	printf("\n");
	printf("devMode.dmScale: %d\n", devMode.dmScale);
	//printf("devMode.: %\n", devMode.);

}

void ScreenFenBianLv_0101()
{
	DEVMODEA devMode;
	EnumDisplaySettingsA(NULL, ENUM_CURRENT_SETTINGS, &devMode);

	printf("devMode.dmDeviceName: %s\n", devMode.dmDeviceName);
	printf("devMode.dmSpecVersion: %d\n", devMode.dmSpecVersion);
	printf("devMode.dmDriverVersion: %d\n", devMode.dmDriverVersion);
	printf("devMode.dmSize: %d\n", devMode.dmSize);
	printf("devMode.dmDriverExtra: %d\n", devMode.dmDriverExtra);
	printf("devMode.dmFields: %u\n", devMode.dmFields); // DM_PELSWIDTH(0x00080000L)  DM_PELSHEIGHT(0x00100000L)

	printf("\n");
	printf("\t\t\t union DUMMYUNIONNAME\n");
	printf("\t\t\t union DUMMYUNIONNAME.DUMMYSTRUCTNAME\n");
	printf("devMode.dmOrientation: %d\n", devMode.dmOrientation);
	printf("devMode.dmPaperSize: %d\n", devMode.dmPaperSize);
	printf("devMode.dmPaperLength: %d\n", devMode.dmPaperLength);
	printf("devMode.dmPaperWidth: %d\n", devMode.dmPaperWidth);
	printf("devMode.dmScale: %d\n", devMode.dmScale);
	printf("devMode.dmCopies: %d\n", devMode.dmCopies);
	printf("devMode.dmDefaultSource: %d\n", devMode.dmDefaultSource);
	printf("devMode.dmPrintQuality: %d\n", devMode.dmPrintQuality);

	printf("\t\t\t union DUMMYUNIONNAME.DUMMYSTRUCTNAME2\n");
	printf("devMode.dmPosition -> x: %ld, y: %ld\n", devMode.dmPosition.x, devMode.dmPosition.y);
	printf("devMode.dmDisplayOrientation: %u\n", devMode.dmDisplayOrientation);
	printf("devMode.dmDisplayFixedOutput: %u\n", devMode.dmDisplayFixedOutput);

	printf("\n");
	printf("devMode.dmColor: %d\n", devMode.dmColor);
	printf("devMode.dmDuplex: %d\n", devMode.dmDuplex);
	printf("devMode.dmYResolution: %d\n", devMode.dmYResolution);
	printf("devMode.dmTTOption: %d\n", devMode.dmTTOption);
	printf("devMode.dmCollate: %d\n", devMode.dmCollate);
	printf("devMode.dmFormName: %s\n", devMode.dmFormName);
	printf("devMode.dmLogPixels: %d\n", devMode.dmLogPixels);
	printf("devMode.dmBitsPerPel: %u\n", devMode.dmBitsPerPel);
	printf("devMode.dmPelsWidth: %u\n", devMode.dmPelsWidth);
	printf("devMode.dmPelsHeight: %u\n", devMode.dmPelsHeight);

	printf("\n");
	printf("\t\t\t union DUMMYUNIONNAME2\n");
	printf("devMode.dmDisplayFlags: %u\n", devMode.dmDisplayFlags);
	printf("devMode.dmNup: %u\n", devMode.dmNup);

	printf("\n");
	printf("devMode.dmDisplayFrequency: %u\n", devMode.dmDisplayFrequency);
	printf("devMode.dmICMMethod: %u\n", devMode.dmICMMethod);
	printf("devMode.dmICMIntent: %u\n", devMode.dmICMIntent);
	printf("devMode.dmMediaType: %u\n", devMode.dmMediaType);
	printf("devMode.dmDitherType: %u\n", devMode.dmDitherType);
	printf("devMode.dmReserved1: %u\n", devMode.dmReserved1);
	printf("devMode.dmReserved2: %u\n", devMode.dmReserved2);
	printf("devMode.dmPanningWidth: %u\n", devMode.dmPanningWidth);
	printf("devMode.dmPanningHeight: %u (0x%x)\n", devMode.dmPanningHeight, devMode.dmPanningHeight);
	//printf("devMode.: %u\n", devMode.);

	//printf("devMode.: %\n", devMode.);
	//printf("devMode.: %\n", devMode.);
	//printf("devMode.: %\n", devMode.);


	//printf("devMode.: %\n", devMode.);

}